<!DOCTYPE html>
<html>
<head>
    <title>用户获得商品</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <#include "../../../../include/resources.html">
        <script type="text/javascript">
            var dataGrid;
            var winWidth =  700; //弹出窗口宽度
            var winHeight = 800; //弹出窗口高度

            var detailTitle = "用户获得商品详情";
            var detailUrl = "/modules/additional/commodity/userCommodityDetailPage.html";

            var auditTitle = "审核";
            var auditUrl =  "/modules/additional/commodity/userCommodityAuditPage.html";

            var postTitle = "发货";
            var postUrl = "/modules/additional/commodity/userCommodityPostPage.html";

            $(function() {
                dataGrid = $('#dataGrid').datagrid({
                    url : 'userCommodityList.html',
                    fit : true,
                    fitColumns : true,
                    border : false,
                    pagination : true,
                    idField : 'id',
                    pageSize : pageSize,
                    pageNums :1,
                    pageList : pageList,
                    sortName : 'id',
                    sortOrder : 'asc',
                    checkOnSelect : false,
                    selectOnCheck : false,
                    nowrap : false,
                    singleSelect:true,
                    columns : [ [
                        { field: 'id', title: '编号', width: 50, checkbox : false},
                        { field: 'userName', title: '用户名', width: 50, checkbox : false},
                        { field: 'realName', title: '真实姓名', width: 50, checkbox : false},
                        { field: 'commodityName', title: '物品名称', width: 50, checkbox : false},
                        { field: 'status', title: '状态', width: 50, sortable:false,formatter:function(value,row,index){
                            if(row.status == -1)
                                return "审核未通过";
                            else if(row.status == 0)
                                return "待审核";
                            else if(row.status == 1)
                                return "审核通过";
                            else if(row.status == 2)
                                return "已发货";
                            else if(row.status == 3)
                                return "已收货";
                        } },
                        { field: 'receiver', title: '收件人', width: 40, sortable:false},
                        { field: 'expressName', title: '快递名称', width: 40, sortable:false},
                        { field: 'description', title: '获取来源', width: 40, sortable:false},
                        { field: 'auditName', title: '审核人', width: 40, sortable:false},
                        { field: 'auditTime', title: '审核时间', width: 80, sortable:false,formatter: function(value,row,index){
                            return getLocalTime(value,4);
                        }
                        },
                        { field: 'auditRemark', title: '审核备注', width: 80, sortable:false},
                        { field : 'showInfo',
                            title : '其他信息',
                            width :75,
                            fixed : true,
                            align : 'center',
                            formatter : function(value, row, index) {
                                var content = '<a href="javascript:void(0);" class="j-showInfo">查看<i class="iconfont">&#xe639;</i></a>'
                                        + '<div class="showInfoSingleDiv">'
                                        + '<div class="showInfo">'
                                        + '<em></em><h2>获得物品信息</h2>'
                                        + '<ul>'
                                        + '<li>'
                                        + '<span>收件人：</span>'
                                        + row.receiver
                                        + '</li>'
                                        + '<li>'
                                        + '<span>收件人电话：</span>'
                                        + row.receivePhone
                                        + '</li>'
                                        + '<li>'
                                        + '<span>收件人手机：</span>'
                                        + row.receiveMobile
                                        + '</li>'
                                        + '<li>'
                                        + '<span>收件人地址：</span>'
                                        + row.receiveAddress
                                        + '</li>'
                                        + '<li>'
                                        + '<span>获取ip：</span>'
                                        + row.addIp
                                        + '</li>'
                                        + '<li>'
                                        + '<span>获取时间：</span>'
                                        + getLocalTime(row.addTime,4)
                                        + '</li>'
                                        + '<li>'
                                        + '<span>快递单号：</span>'
                                        + row.expressNum
                                        + '</li>'
                                        + '<li>'
                                        + '<span>发货时间：</span>'
                                        + getLocalTime(row.postTime,4)
                                        + '</li>'
                                        + '</ul></div></div>';
                                return content;
                            }
                        },
                        { field : 'action',
                            title : '操作',
                            width : 75,
                            fixed : true,
                            align : 'center',
                            formatter : function(value, row, index) {
                                var state = row.status;
                                var str = '';
                                str += '<dl>';
                                str += '<dt><a href="javascript:void(0);" onclick="$.fn.dataGridOptions.closeFun('+row.id+',detailTitle,winWidth,winHeight,detailUrl);" title="'+detailTitle+'">详情</a><i class="iconfont">&#xe639;</i></dt>' ;
                                str += '<dd>';
                                switch(state) {
                                    case 0 :
                                        str += '<a href="javascript:void(0);" onclick="$.fn.dataGridOptions.editFun('+row.id+',auditTitle,winWidth,winHeight,auditUrl);" title="'+auditTitle+'">审核</a>';
                                        break;
                                    case 1 :
                                        str += '<a href="javascript:void(0);" onclick="$.fn.dataGridOptions.editFun('+row.id+',postTitle,winWidth,winHeight,postUrl);" title="'+postTitle+'">发货</a>';
                                        break;
                                    case -1 :
                                        str += '<a href="javascript:void(0);">审核未通过</a>';
                                        break;
                                    case 3 :
                                        str += '<a href="javascript:void(0);">已发货</a>';
                                        break;
                                }
                                str += '</dd>';
                                str +=  '</dl>';
                                return str;
                            }
                        }

                    ] ],
                    toolbar : '#toolbar',
                    onLoadSuccess : function() {
                        $('#searchForm table').show();
                        parent.$.messager.progress('close');
                    }
                });
            });

        </script>
</head>
<body style="padding:0 20px;" >
<div class="easyui-layout" data-options="fit : true,border : false">
    <div data-options="region:'north',border:false,collapsible:false" id="searchBox">
        <div class="sLeft">
            <form id="searchForm">
                <input type="text"  name="searchName" id="searchName" class="sInput" placeholder="输入用户名进行搜索" autocomplete="off" onkeydown="if(event.keyCode == 13){ $.fn.dataGridOptions.searchFun('#searchForm');return false;}"/><a href="javascript:;" title="查询" class="sBtn" onclick="$.fn.dataGridOptions.searchFun('#searchForm');">查询</a><a href="javascript:;" class="advBtn" title="模糊条件查询">模糊条件查询 <i class="iconfont">&#xe638;</i></a>
                <a href="javascript:void(0);" class="reloadIcon" onclick="dataGrid.datagrid('reload');" title="刷新" ><i class="iconfont">&#xe603;</i></a>
            </form>
        </div>
        <form id="showAdw">
            <ul class="showAdw" style="display:none;">
                <a href="javascript:void(0);"><i class="iconfont closeWin">&#xe63a;</i></a>
                <li><span>用户名</span><input type="text" name="userName" id="userName" autocomplete="off"/></li>
                <li><span>商品名称</span><input type="text" name="commodityName" id="commodityName" autocomplete="off"/></li>
                <li><span>状态</span><select name="status" id="status" class="status">
                    <option value=99>全部</option>
                    <option value="0">待审核</option>
                    <option value="1">审核通过</option>
                    <option value="-1">审核未通过</option>
                    <option value="2">已发货</option>
                    <option value="3">已收货</option>
                </select></li>
                <li><span>快递单号</span><input type="text" name="expressNum" id="expressNum" autocomplete="off"/></li>
                <li><span></span><a href="javascript:void(0);" class="searchBtn sureBtn" onclick="$.fn.dataGridOptions.searchFun('#showAdw');">确定</a><a href="javascript:void(0);" class="searchBtn" onclick="$.fn.dataGridOptions.cleanFun('#searchForm');">重置</a></li>
            </ul>
        </form>
        <div class="sRight">
        </div>
    </div>
    <div data-options="region:'center'" style="margin-top:30px;padding-bottom:30px;">
        <table id="dataGrid"></table>
    </div>
</div>
</body>
</html>
<script src="${theme_dir}/js/search.js"></script>